﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Music.Master" AutoEventWireup="true" CodeBehind="MusicTemplate.aspx.cs" Inherits="MusaDor.Music" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript" src="../Scripts/xplayer.js"></script>
<script type="text/javascript" src="../Scripts/klass.min.js"></script>
<script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="plr">
        <asp:FormView ID="PlayerData" DataSourceID="PlayerDataSource" runat="server" CssClass="Player">
            <ItemTemplate>
                <center class="SN">
                    <asp:Label ID="NameOfSong" CSSClass="SongName" runat="server" Text='<%# Eval("Title")%>'></asp:Label>
                </center>
                <div id="player" source="<%# Eval("FileName")%>" >
                </div>
            </ItemTemplate>
        </asp:FormView>
    </div>
    <asp:SqlDataSource ID="PlayerDataSource" runat="server"  ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [ArticleID], [FileName], [Title] FROM [md_Articles] WHERE ([ArticleID] = @ArticleID)"  >
                <SelectParameters>
                    <asp:ControlParameter ControlID="SongsList"  Name="ArticleID" PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
    <br/>
    <div id="playlist">    
        <asp:ListView ID="SongsList" DataKeyNames="ArticleID" runat="server" DataSourceID="SongListDataSource">
                <LayoutTemplate>
                    <div ID="itemPlaceholder" runat="server">
                    </div>
                </LayoutTemplate>  
                <ItemTemplate> 
                    <asp:LinkButton ID="LinkButton1" Text='<%# Eval("Title") %>' CommandName="Select" runat="server" />
                </ItemTemplate>
           </asp:ListView>
        <asp:SqlDataSource ID="SongListDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            
            SelectCommand="SELECT [ArticleID], [CategoryID], [Title], [FileName], [Approved] FROM [md_Articles] WHERE ([CategoryID] = @CategoryID)" >
            <SelectParameters>
                <asp:Parameter DefaultValue="13" Name="CategoryID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
